import { configureStore ,combineReducers } from "@reduxjs/toolkit";
import data from "../reduers/data";
import { persistStore,persistReducer} from 'redux-persist'
import storage from 'redux-persist/lib/storage'

const persistConfig = {
    key: 'root',
    storage,
  };
  
  export const rootReducer = combineReducers({
    MyData:data
})
const myPersistReducer = persistReducer(persistConfig, rootReducer)
const store = configureStore({
    reducer:myPersistReducer,
    middleware: (getDefaultMiddleware) =>
    getDefaultMiddleware({
      serializableCheck: false,
    })
} 
) 

export default store
export const persistor = persistStore(store)